Skip to content

[Tests, CMake] Add dependencies in Mapping/Testing CMakeLists.txt - #6394

Merged
fredroy merged 5 commits into
sofa-framework:masterfrom
CRIStAL-PADR:pr-add-dependencies-mapping
Oct 25, 2026
Merged

fredroy merged 5 commits into
sofa-framework:masterfrom
CRIStAL-PADR:pr-add-dependencies-mapping

Conversation

@damienmarchal

@damienmarchal damienmarchal commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Some dependencies seems to be missing resulting in missing includes.

This PR fix a compilation error that I is un-detected on the CI because others CMakeLists.txt are hidding the problem. You notice it if you make your own mapping an want to test it in your plugin.

Here is the problem complete description:

  1. The Mapping.Testing target is only containing .h files and "empty.cpp". This empty.cpp does not include the .h... so compiling Mapping.Testing does not involve at all reading the .h.

  2. Looking at one of these header (eg: MappingTestCreation.h) clearly show that, on that target, the proper dependencies are missing resulting in editors errors hints on the #include<>

image
  1. The Mapping.Testing target is then used as a dependecy to build other target, the ones which actually implements the tests. These targets hides the problem because they adds in there own CMakeLists.txt the missing dependencies (eg: Sofa.Test and Sofa.SimpleAPI). As Mapping.Testing contains only .h stuff adding the dependencies at that location makes everything compile.

  2. If you build your own target to test a mapping using Mapping.Testing... it will not work unless you add manually on your target the dependencies that should be in Mapping.Testing.

I have added #include in empty.cpp. With this change and without the fix the compilation would fail on the CI. This will allow to detect other missing dependencies in the future as well as plenty of error in Multi2Mapping... which makes me thing that nobody is actually using it.


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@damienmarchal damienmarchal added pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request labels Oct 14, 2026
@damienmarchal damienmarchal changed the title Add proper dependencies in Mapping/Testing CMakeLists.txt Add dependencies in Mapping/Testing CMakeLists.txt Oct 14, 2026

@fredroy fredroy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch contains #6381

@damienmarchal
damienmarchal force-pushed the pr-add-dependencies-mapping branch from 4a9e2aa to 43eff52 Compare October 16, 2026 09:33
@damienmarchal

Copy link
Copy Markdown
Contributor Author

This branch contains #6381

Thanks.

@bakpaul

bakpaul commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Wasn't the project compiled on the CI ? Does this fix a current compilation error ?

@damienmarchal

damienmarchal commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

This fix a compilation error that I is un-detected on the CI because others CMakeLists.txt are hidding the problem.
You notice it if you make your own mapping an want to test it in your plugin.
I copy pasted my explaination in the PR description.

@damienmarchal
damienmarchal force-pushed the pr-add-dependencies-mapping branch from 392c557 to 80c4432 Compare October 16, 2026 11:29
Fix other issues that pop's up when doing so.
@damienmarchal
damienmarchal force-pushed the pr-add-dependencies-mapping branch from 80c4432 to c3d3d58 Compare October 16, 2026 11:30
damienmarchal and others added 3 commits October 16, 2026 13:32
After inclusion of the header in empty.cpp it appears this header was out of sync
with a lot of sofa evolution.
@fredroy fredroy changed the title Add dependencies in Mapping/Testing CMakeLists.txt [Tests, CMake] Add dependencies in Mapping/Testing CMakeLists.txt Oct 25, 2026
@fredroy fredroy added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Oct 25, 2026
@fredroy
fredroy merged commit 7cda895 into sofa-framework:master Oct 25, 2026
16 of 21 checks passed
bakpaul pushed a commit to bakpaul/sofa that referenced this pull request Oct 29, 2026
…fa-framework#6394)

* Add proper dependencies in Mapping/Testing

* Add all headers in empty.cpp to force checking the #include

Fix other issues that pop's up when doing so.

* Fix all errors in Multi2MappingTestCreation.h

After inclusion of the header in empty.cpp it appears this header was out of sync
with a lot of sofa evolution.
@hugtalbot hugtalbot added this to the v26.12 milestone Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: fix Fix a bug pr: status ready Approved a pull-request, ready to be squashed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants